package 作业;

import java.util.*;

public class two {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        Map map = new HashMap();
        map.put("帝骑","装逼合集");
        map.put("创骑","制造合集");
        map.put("甲斗王","装逼合集");
        map.put("Lucy","变身合集 ");
        System.out.println("*****欢迎来到假面骑士学院*****");
        System.out.println("我们目前一共有"+map.size()+"课");
        System.out.println("准备新增一门课");
        map.put("Allen","JDBC");
        System.out.println("现在有"+map.size()+"课");
        map.put("Lucy","CoreJava ");
        System.out.println("将Lucy老师的<变身合集>,改为"+map.get("Lucy"));
        Set set=map.keySet();
        Iterator it =set.iterator();
        while(it.hasNext()){
            String key=(String)it.next();
            String name=(String)map.get(key);
            System.out.println(name);
        }
        System.out.println("\n将所有<装逼合集>改为<平成骑士合集>");
        Set set1=map.keySet();
        Iterator it1 =set.iterator();
        while(it1.hasNext()){
            String key=(String)it1.next();
            String name=(String)map.get(key);
            if (map.get(key).equals("装逼合集")){
                name="平成骑士合集";
            }
            System.out.println(name);
        }

        }
    }

